using Microsoft.Scripting;

namespace Supremacy.Scripting.Ast
{
    public class TopLevelParameterInfo : IKnownVariable
    {
        public TopLevelScope Scope { get; private set; }

        SourceSpan IKnownVariable.Span
        {
            get { return this.Parameter.Span; }
        }

        public int Index { get; private set; }

        public Parameter Parameter
        {
            get { return this.Scope.Parameters[Index]; }
        }

        public TopLevelParameterInfo(TopLevelScope block, int index)
        {
            this.Scope = block;
            this.Index = index;
        }

        Scope IKnownVariable.Scope
        {
            get { return this.Scope; }
        }
    }
}